From: DannyS712 Date: Mon, 19 Aug 2019 02:13:32 +0000 (+0000) Subject: Clean up ApiEditPage content handler undo logic X-Git-Tag: 1.34.0-rc.0~681^2~1 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/config/index.php?a=commitdiff_plain;h=01564dcbf76cd279c88320f96f0844cfadf4f7c9;p=lhc%2Fweb%2Fwiklou.git Clean up ApiEditPage content handler undo logic Bug: T230702 Change-Id: I79d528866c54f40c5adcffde8410b9e2d5336ea7 --- diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index 3f63a0085a..554df61e9c 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -92,9 +92,8 @@ class ApiEditPage extends ApiBase { $name = $titleObj->getPrefixedDBkey(); $model = $contentHandler->getModelID(); - if ( $params['undo'] > 0 ) { - // allow undo via api - } elseif ( $contentHandler->supportsDirectApiEditing() === false ) { + // always allow undo via api, T230702 + if ( !( $params['undo'] > 0 ) && $contentHandler->supportsDirectApiEditing() === false ) { $this->dieWithError( [ 'apierror-no-direct-editing', $model, $name ] ); }